package goProject_nwn

import (
	"fmt"
	"math/rand"
)

func main() {
	for true {
		var choice, name string
		names := []string{"wangguang", "wangyong", "niweinan", "huangyongjing", "sunyuanyuan", "chensiyu", "zhouyongping"}
		fmt.Print("####随机点名系统####\n1.增加人员\n2.开始随机\n3.按q退出\n输入选择：")
		fmt.Scan(&choice)
		fmt.Println("人员名单:", names)
		if choice == "1" {
			fmt.Print("输入新增人员姓名:")
			fmt.Scan(&name)
			names = append(names, name)
		} else if choice == "2" {
			random_num := rand.Intn(len(names))
			fmt.Println("中奖人员:", names[random_num])
			names = append(names[:random_num], names[random_num+1:]...)
		} else if choice == "q" {
			break
		}
	}

}
